

import java.util.Iterator;

import java.util.Set;

//import data.Table.Table;

import exc.DBlite;
import buffer.pager;
public class TableTest {

	public static void main(String[] args){
		


		DBlite db = new DBlite();

   // 	db.Clear("test");
		
//		Table tb = db.Open("test");
		pager pg = db.Ini("test");
		
		db.CreateTable(pg, "fruit", "id","int","type","int","describe","text");
		
		
		
		
		
		
		
//		
//		tb.writeTableByte("ddd", "id","int","num","long");
//		tb.writeTableByte("a", "id","int","address","text");
//		tb.writeTableByte("abc", "id","int");
//		tb.writeTableByte("abdc", "id","int");
//		tb.writeHead();
//	
//
//		pager buffer = new pager("test");
		

		
		
		
		Set<String> sa= pg.Alltables.keySet();
		Iterator<String> it = sa.iterator();

		while(it.hasNext()){
			String tbname = it.next();
			System.out.println("-------------"+pg.Alltables.get(tbname).getTableName());
			System.out.print(pg.Alltables.get(tbname).getRootPageNum()+"--");
			System.out.print(pg.Alltables.get(tbname).getTableNum()+"--");
			System.out.print(pg.Alltables.get(tbname).getElements()+"--");
			System.out.println(pg.Alltables.get(tbname).getTypes());
			
			
		}


		
		
		
	}
}
